<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>手机端m3u8</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/demo.css">
<style>

</style>
</head>
<body>
<div class="container">
    <header>
        <div class="row">
            <div class="col-md-3 col-xs-12">手机端m3u8</a></h1></div>
            <div class="col-md-9 text-right"</div>
        </div>
    </header>
    <div class="row main">
        <div class="col-md-12">
           
            <div class="container" style="width: 96%; margin: 30px auto">
                <video id="video" controls loop="false" width="100%"></video>
            </div>
        </div>
    </div>
   
</div>
<script src="hls.js"></script>

<script>
var video = document.getElementById('video');
  if(Hls.isSupported()) {
    var hls = new Hls();
    //hls.loadSource('https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8');
    hls.loadSource('https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8');
    hls.attachMedia(video);
    hls.on(Hls.Events.MANIFEST_PARSED,function() {
      video.play();
  });
 } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
    //video.src = 'https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8';
    video.src = 'https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8';
    video.addEventListener('loadedmetadata',function() {
      video.play();
    });
  }else{
      alert('不支持hls');
  }
</script>
</body>
</html>